libxl: correct allocation size in libxl_list_vm
authorIan Campbell <ian.campbell@citrix.com>
Wed, 28 Sep 2011 15:34:00 +0000 (16:34 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Wed, 28 Sep 2011 15:34:00 +0000 (16:34 +0100)
commit03744e707be948416fabade6fe027a2c4fa2397e
treea77a3c836b95e10834d698f704cc9ec062d51d69
parent990adf50fbf1e587456f31421309fd49b59b06ff
libxl: correct allocation size in libxl_list_vm

*ptr has type libxl_vminfo not libxl_domid, so correct calloc call.

This the second instance of this bug I've noticed recently, I did a
quick audit of other similar uses of sizeof(...) and all I spotted
were a couple of harmlessly reversed calloc arguments. It's a pretty
strong argument for "foo = ..alloc(sizeof(*foo))" rather than
"alloc(sizeof(foos_type))" though...

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxl/libxl.c
tools/libxl/libxl_dm.c